package com.zj.eurekaclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Auther: zj
 * @Date: 2018/11/14 11:09
 * @Description:
 */
@FeignClient(name="user",fallback = UserClient.UserFallback.class)//name是要访问应用的接口
public interface UserClient {

    @GetMapping("/msg")
    String test2();//该方法名可以自己定义

    @Component
    class UserFallback implements UserClient {

        @Override
        public String test2() {
            return null;
        }
    }

}
